﻿using Cms.Core.Data.Audit;
using Cms.Core.Data.Mapping;
using Cms.Core.Data.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;


namespace Cms.Core.Data.Configurations
{
    public class AuditEntryConfigurations : EntityMappingConfiguration<AuditEntry>
    {
    

        public override void Map(EntityTypeBuilder<AuditEntry> builder)
        {
            base.MapCommon(builder);

            builder.Property(b => b.TableName).HasColumnType("nvarchar(50)").IsRequired(true);

            builder.Property(b => b.KeyValues).HasColumnType("nvarchar(500)").IsRequired(false);

            builder.Property(b => b.OldValues).HasColumnType("nvarchar(500)").IsRequired(false);
            builder.Property(b => b.NewValues).HasColumnType("nvarchar(500)").IsRequired(false);
            builder.Property(b => b.EntityState).IsRequired(true);
            builder.ToTable("AuditEntry");
        }

     
    }
}
